cmake_minimum_required(VERSION 3.17)
project(syllabus)

set(CMAKE_CXX_STANDARD 20)

#去除依赖库
macro(ModuleSetWinCompilerFlags)
    IF (WIN32)
        set(CompilerFlags
                CMAKE_CXX_FLAGS
                CMAKE_CXX_FLAGS_DEBUG
                CMAKE_CXX_FLAGS_RELEASE
                CMAKE_CXX_FLAGS_RELWITHDEBINFO
                CMAKE_CXX_FLAGS_MINSIZEREL
                CMAKE_C_FLAGS
                CMAKE_C_FLAGS_DEBUG
                CMAKE_C_FLAGS_RELEASE
                CMAKE_C_FLAGS_RELWITHDEBINFO
                CMAKE_C_FLAGS_MINSIZEREL
                )
        foreach(CompilerFlag ${CompilerFlags})
            string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
        endforeach()
    ENDIF (WIN32)
endmacro(ModuleSetWinCompilerFlags)
ModuleSetWinCompilerFlags()

#boost
include_directories( "D:\\ProgramData\\cpp_repository\\boost_1_74_0")
link_directories("D:\\ProgramData\\cpp_repository\\boost_1_74_0\\stage\\lib")

#mysql
include_directories("C:\\Program Files\\MySQL\\MySQL Server 5.6")
link_directories("C:\\Program Files\\MySQL\\MySQL Server 5.6\\lib")
link_libraries("C:\\Program Files\\MySQL\\MySQL Server 5.6\\lib\\libmysql.lib")

#dependence
include_directories(include ./ormpp/iguana ./ormpp)
add_definitions(-DORMPP_ENABLE_MYSQL)
include_directories(./)

add_executable(syllabus main.cpp)
add_executable(test test.cpp)
target_precompile_headers(syllabus PUBLIC cinatra.hpp)
target_precompile_headers(syllabus PUBLIC ./ormpp/dbng.hpp)
target_precompile_headers(syllabus PUBLIC ./ormpp/mysql.hpp)